<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
    </head>
    <style>
        .contain {
            height: 200vh;
            background-color: red;
            position: relative;
            width: 1000px;
            left: 200px;
        }
        .block {
            height: 300px;
            width: 200px;
            background-color: black;
            position: absolute;
            top: 200px;
        }
    </style>
    <body>

        <div class="contain">
            <div class="block"></div>
            <div class="block" style="z-index: 1;top: 20px;"></div>
            <div class="block" style="z-index: 2;top: 20px;"></div>
            <div class="block" style="z-index: 3;top: 20px;"></div>
        </div>

    </body>
</html>
